# 非常简单的加强版index，应该不需要注释也能看懂
def EnhancedIndex(List, IndexNum):
    result_list = list()
    count = 0
    for Num in List:
        if Num == IndexNum:
            result_list.append(count)
        count += 1
    return result_list


if __name__ == '__main__':
    List = [1, 2, 3, 4, 1, 2, 3, 1]
    print(EnhancedIndex(List, 1))
